package demo.kk;


/**
* 
* @author : feixiang.li
* @since : 2025-09-16 18:17
*/
public class Test2 {
    public static void main(String[] args) {
        String str1 = "a";
        String str2 = "a";
        System.out.println(str1 == str2);
        System.out.println(str1.equals(str2));
         str1 = new String("a");
         str2 = "a";
         System.out.println(str1 == str2);
         System.out.println(str1.equals(str2));
         str1 = new String("a");
         str2 = new String("a");
        System.out.println(str1 == str2);
        System.out.println(str1.equals(str2));

        Integer a = new Integer(1);
        Integer b = new Integer(1);
        System.out.println(a == b);
        System.out.println(a.equals(b));
        a=1;
        b=1;
        System.out.println(a == b);
        System.out.println(a.equals(b));

        a=1000;
        b=1000;
        System.out.println(a == b);
        System.out.println(a.equals(b));
    }
}
